package no.sachmuld.methodcombination.examples.reflection.designbycontract.stack;

import no.sachmuld.methodcombination.api.Condition;
import no.sachmuld.methodcombination.api.Context;
import no.sachmuld.methodcombination.api.MethodInvocation;

/**
 *
 */
public abstract class StackBehaviour <T> {

    public Condition beforePush(T element, Context context) {
        return new Condition(true);
    }

    public void push(T element, MethodInvocation<Void> methodInvocation) {
        methodInvocation.proceed();
    }

    public Condition afterPush(T element, Context context) {
        return new Condition(true);
    }

    public Condition beforeTop(Context context) {
        return new Condition(true);
    }

    public T top(MethodInvocation<T> methodInvocation) {
        return methodInvocation.proceed();
    }

    public Condition afterTop(T result, Context context) {
        return new Condition(true);
    }

    public Condition beforePop(Context context) {
        return new Condition(true);
    }

    public T pop(MethodInvocation<T> methodInvocation) {
        return methodInvocation.proceed();
    }

    public Condition afterPop(T result, Context context) {
        return new Condition(true);
    }

    public Condition beforeEmpty(Context context) {
        return new Condition(true);
    }

    public boolean empty(MethodInvocation<Boolean> methodInvocation) {
        return methodInvocation.proceed();
    }

    public Condition afterEmpty(boolean result, Context context) {
        return new Condition(true);
    }

    public Condition beforeSize(Context context) {
        return new Condition(true);
    }

    public int size(MethodInvocation<Integer> methodInvocation) {
        return methodInvocation.proceed();
    }

    public Condition afterSize(int result, Context context) {
        return new Condition(true);
    }

}
